/*
*用途：管理员表
*作者：hwq
*创建日期：2019-01-14 16:50
*/
const Sequelize = require('sequelize')
const sequelize = require('./sequelize')
const Role = require('./role')

const Manager = sequelize.define('manager',{
  id: { type: Sequelize.INTEGER, allowNull: false, autoIncrement: true, primaryKey: true },
  account: { type: Sequelize.STRING, allowNull: false },
  passwd: { type:Sequelize.STRING, allowNull: false },
  state: { type: Sequelize.BOOLEAN, defaultValue: true },
  roleid: { type: Sequelize.INTEGER, references: { model: Role, key: 'id' } },
  realname: { type: Sequelize.STRING },
  salt: { type: Sequelize.STRING, allowNull: false },
  telephone: { type: Sequelize.STRING },
  email: { type: Sequelize.STRING }
})

module.exports = Manager